package com.bm.web.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * Servlet implementation class projectServlet
 */
@WebServlet("/projectServlet")
public class projectServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public projectServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		request.setCharacterEncoding("UTF-8");
		String projectName = request.getParameter("projectId");
		HttpSession session = request.getSession();
		if(projectName.equals("内江水磨石砖生产")) {
			session.setAttribute("photo", "image/工程案例/e13a1867-caf1-4bfa-a622-77503ce79661.jpg");
			session.setAttribute("projectName", "内江水磨石生产");
		}else if(projectName.equals("成都水磨石砖设计效果")) {
			session.setAttribute("photo", "image/工程案例/8f750a3f-3693-4849-bdbd-33236705b7ef.jpg");
			session.setAttribute("projectName", "成都水磨石砖设计效果");	
		}else if(projectName.equals("南充水磨石砖设计")) {
			session.setAttribute("photo", "image/工程案例/a901eb9d-5f95-4d05-9c74-1c718db2597c.jpg");
			session.setAttribute("projectName", "南充水磨石设计");
		}else if(projectName.equals("重庆水磨石砖设计安转")) {
			session.setAttribute("photo", "image/工程案例/91e3eb70-6233-480b-bc83-f0b488d4f4d5.jpg");
			session.setAttribute("projectName", "重庆水磨石砖");
		}else if(projectName.equals("广元水磨石砖安转效果")) {
			session.setAttribute("photo", "image/工程案例/2e975166-03c0-4bed-825c-8b5977c1590f.jpg");
			session.setAttribute("projectName", "广元水磨石砖安装效果");
		}else if(projectName.equals("酒店水磨石砖地板展示")) {
			session.setAttribute("photo", "image/工程案例/6589ed52-4504-4731-a303-6b0e97cee653.jpg");
			session.setAttribute("projectName", "酒店水磨石砖地板展示");
		}else if(projectName.equals("南充水磨石砖-工艺定制品")) {
			session.setAttribute("photo", "image/工程案例/55f3e4f6-731d-4470-8e99-97dca75a7018.jpg");
			session.setAttribute("projectName", "南充水磨石砖-工艺定制品");
		}else if(projectName.equals("绵阳水磨石砖安转效果")) {
			session.setAttribute("photo", "image/工程案例/3ca36d89-7342-4e83-88bb-1f2ddc0d8123.jpg");
			session.setAttribute("projectName", "绵阳水磨石砖安装效果");
		}else if(projectName.equals("成都水磨石砖安转案例")) {
			session.setAttribute("photo", "image/工程案例/83459b04-ba5d-4045-bf58-baddad72d32b.jpg");
			session.setAttribute("projectName", "成都水磨石砖安装案例");
		}
		
		response.sendRedirect("project-JoinShow.jsp");
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
